﻿@model VisaApp.Helper.PagedData<VisaApp.Models.TinOfMenuModel>
@{ VisaApp.Helper.StringHelpers nameurl = new VisaApp.Helper.StringHelpers();}
<script type="text/javascript">
    $(document).ready(function () {
        $(".page-number").live("click", function () {
            show_Loading();
            var page = parseInt($(this).html());
            $.get("/News/GeTinOFmenuOnCate?page=" + page + "&cate=" + @ViewBag.cateCode , function (data) {
                $(".FromListThongtinCanbietTTHI").html("");
                $(".FromListThongtinCanbietTTHI").html(data);
                $('#box-busy').fadeOut('medium', function () {
                    $('.black_overlay').css('display', 'none');
                });

            });
        });
    });

</script>
<div class="service-c2-ct">
    @if (Model.Data != null)
    {
        if (Model.Data.Count() == 1)
        {
            var itemFirs = Model.Data.First();
            <h1 class="Title">@itemFirs.Name</h1>
            <div class="ContenInfoThongtin">
                @Html.Raw(itemFirs.DescriptFull)
            </div>
            @*<div class="titleKhac">
                Tin liên quan
            </div>*@
            @*<div class="contentListThongtinHuuichKhac">
                @Html.Action("Newslistkhac", "News", new { id = Model.Id, page = 1 })
            </div>*@
        }
        else
        {
            foreach (var item in Model.Data)
            {
                
        <div class="web-all-box">
            <div class="service-c2-boxL">
                <a href="/thong-tin-chi-tiet/@nameurl.RemoveSign4VietnameseString(item.Name)/@item.Id">
                    <img alt="" title="Xem chi tiết : @item.Images" width="126" height="126" src="@item.Images"></a>
            </div>
            <div class="web-all-boxR">
                <div style="cursor: pointer;" class="service-c2-title">
                    <a class="aTtHuDetails" href="/thong-tin-chi-tiet/@nameurl.RemoveSign4VietnameseString(item.Name)/@item.Id">@item.Name</a>
                </div>
                <div class="service-c2-ct">
                    @Html.Raw(item.Description)
                </div>
                <div class="wa-box-btn">
                    <input onclick="window.location='/thong-tin-chi-tiet/@nameurl.RemoveSign4VietnameseString(item.Name)/@item.Id';" class="wa-btn"
                                type="button" value="">
                </div>
            </div>
        </div>
                
            }
            
        <div class="PageNav">
            <span class="pageNavHeader">Trang @Model.CurrentPage / @Model.NumberOfPages</span>
            @for (int m = 1; m <= Model.NumberOfPages; m++)
            {
                if (m == Model.CurrentPage)
                {
                <a class="currentPage" href="javascript:void(0);">@m</a>
                }
                else
                {
                <a class="page-number" href="javascript:void(0);">@m</a>
                }
            }
            <a href="javsscript:void(0)" class="text">Sau &gt;</a>
        </div>
        }

    }
    else
    {
        <h2>Dữ liệu đang được cập nhật...</h2>
    }
</div>
